<template>
  <div id="login">
    <div class="login_form">
      <div class="left">
        <div>
          <img src="../assets/h_logo-1.png">
          <p>XXXX</p>
          <p>管理系统</p>
        </div>
      </div>
      <div class="right">
        <div class="name">用户登陆</div>
        <el-form
          ref="form"
          :model="loginForm"
          label-width="80px"
        >
          <el-form-item label="用户名">
            <el-input
              v-model="loginForm.userName"
              aria-placeholder="请输入用户名"
              size="mini"
              prefix-icon="el-icon-user-solid"
            ></el-input>
          </el-form-item>
          <el-form-item label="密 码">
            <el-input
              v-model="loginForm.passWord"
              aria-placeholder="请输入密码"
              size="mini"
              prefix-icon="el-icon-user-solid"
              show-password
            ></el-input>
          </el-form-item>
          <el-form-item label="验证码">
            <div class="verification_code">
              <el-input
                v-model="loginForm.textCode"
                size="mini"
              ></el-input>
              <div class="png">
              </div>
            </div>
          </el-form-item>
          <el-form-item label="">
            <el-checkbox v-model="loginForm.rememberPassword">记住密码</el-checkbox>
          </el-form-item>
        </el-form>
        <el-button
          type="primary"
          size="small"
          style="width: 100%"
          @click="loginSignin"
        >登录</el-button>
      </div>
    </div>
  </div>
</template>

<script>
// import md5 from 'md5'
export default {
  data () {
    return {
      loginForm: {
        userName: 'admin',
        passWord: '12345',
        textCode: 'AcvR', // 验证码
        rememberPassword: true // 是否记住密码
      }
    }
  },
  methods: {
    loginSignin () {
      this.$router.push('/homepage/table')
    }
  }
}
</script>
<style lang="less" scoped>
#login {
  width: 100vw;
  height: 100vh;
  background-image: url("../assets/login-background.jpg");
  background-size: 100% 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .login_form {
    width: 40%;
    background: rgba(255, 255, 255, 0.884);
    // border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    .left {
      width: 50%;
      height: 100%;
      display: flex;
      justify-content: center;
      div {
        margin-top: 40px;
        p {
          font-size: 40px;
          font-weight: bold;
          line-height: 40px;
          margin-top: 20px;
          color: rgb(102, 113, 209);
          font-family: "YouSheBiaoTiHei";
        }
        img {
          width: 100px;
          display: block;
          margin: 0 auto;
        }
      }
    }

    .right {
      width: 50%;
      height: 100%;
      padding: 10px;
      border-left: 1px solid rgb(102, 113, 209);
      .name {
        width: calc(100vh - 500px);
        color: rgb(102, 113, 209);
        font-weight: bold;
        font-size: 20px;
        margin-bottom: 20px;
      }
      /deep/.el-form-item .el-input .el-input__inner {
        background-color: rgba(255, 255, 255, 0.452);
        border: 1px solid rgb(102, 113, 209);
      }
      /deep/.el-form-item__label {
        color: rgb(102, 113, 209);
        font-weight: bold;
      }
      /deep/.el-form-item {
        margin-bottom: 8px;
      }
      .verification_code {
        display: flex;
        align-items: center;
        .png {
          width: 45%;
          height: 26px;
          margin-left: 10px;
          border: 1px solid rgb(102, 113, 209);
        }
      }
    }
  }
}
</style>
